package stud.aistar.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import stud.aistar.entity.Phone;

/**
 * *
 *
 * @ClassName :wangyu
 * @Description
 * @Author
 * @Date2019/10/9 16:05
 * @Version V1.0
 */
public interface PhoneMapper {

    @Select("select * from phone where phone = #{p}")
    Phone findPhone(@Param("p") String phone);

    @Insert("insert into phone(phone,code) values(#{p.phone},#{p.code})")
    void insertPhone(@Param("p") Phone phone);

    @Update("update phone set code = #{c} where id = #{ids}")
    void updatePhone(@Param("ids") Integer id,@Param("c") Integer code);
}
